<body>
<div class="wrap">
    <div class="nav">
        <ul class="cc">
            <li><a href="<?php echo U('Admin/UserRole/index'); ?>">角色管理</a></li>
            <li class="current"><a href="javascript:;">权限设定</a></li>
        </ul>
    </div>
    
    <div class="pop_nav">
      <ul class="J_tabs_nav">
        <li class="current"><a href="javascript:;">管理端权限</a></li>
        <li><a href="javascript:;">前台权限</a></li>
      </ul>
    </div>
    
<form class="J_ajaxForm" action="<?php echo U('Admin/UserRole/auth'); ?>" method="post">
<input type="hidden" name="role_id" value="<?php echo $role_info['id']; ?>" >
<div class="J_tabs_contents">
    <div>
    <?php if(!empty($admin)): ?>
    <?php foreach($admin as $node): ?>
        <div class="h_a"><?php echo $node['name']; ?></div>
        <div class="table_full J_check_wrap">
            <table width="100%">
                <col class="th" />
                <col width="400" />
                <col />
                <?php if(!empty($node['left_menu'])): ?>
                <?php foreach($node['left_menu'] as $left): ?>
               <tr>
                    <th><span><?php echo $left['name']; ?></span></th>
                    <td>
                    <?php if(!empty($left['node_items'])): ?>
                        <ul data-name="app_<?php echo $left['id']; ?>" class="three_list cc J_ul_check">
                        <?php foreach($left['node_items'] as $item): ?>
                           <li><label><input name="id[]" data-yid="J_check_app_<?php echo $left['id']; ?>" class="J_check" type="checkbox" value="<?php echo $item['id']; ?>"<?php if(in_array($item['id'],$nodes)) echo ' checked'; ?>><span><?php echo $item['name']; ?></span></label></li>
                        <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>
                    </td>
                    <td><div class="fun_tips"></div></td>
                </tr>
                <?php endforeach; ?>
                <?php endif; ?>
            </table>
        </div>

<?php endforeach; ?>
<?php endif; ?>
      </div>

    <div style="display:none">
    <?php if(!empty($front)): ?>
    <?php foreach($front as $node): ?>
    
        <div class="h_a"><?php echo $node['name']; ?></div>
        <div class="table_full J_check_wrap">
            <table width="100%">
                <col class="th" />
                <col width="400" />
                <col />
                <?php if(!empty($node['left_menu'])): ?>
                <?php foreach($node['left_menu'] as $left): ?>
               <tr>
                    <th><span><?php echo $left['name']; ?></span></th>
                    <td>
                    <?php if(!empty($left['node_items'])): ?>
                        <ul data-name="app_<?php echo $left['id']; ?>" class="three_list cc J_ul_check">
                        <?php foreach($left['node_items'] as $item): ?>
                           <li><label><input name="id[]" data-yid="J_check_app_<?php echo $left['id']; ?>" class="J_check" type="checkbox" value="<?php echo $item['id']; ?>"<?php if(in_array($item['id'],$nodes)) echo ' checked'; ?>><span><?php echo $item['name']; ?></span></label></li>
                        <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>
                    </td>
                    <td><div class="fun_tips"></div></td>
                </tr>
                <?php endforeach; ?>
                <?php endif; ?>
            </table>
        </div>

    <?php endforeach; ?>
    <?php endif; ?>
    </div>

      
</div>
    
    <div class="btn_wrap">
        <div class="btn_wrap_pd">
            <button class="J_ajax_submit_btn btn btn_submit" type="submit">提交</button>
        </div>
    </div>
    
    </form>
</div>
</body>
